//Fractal system for createing terrain
#ifndef FRACTAL_H
#define FRACTAL_H

#include "D3DApp.h"
#include "Graph.h"
#include <vector>
class Fractal
{
public:
	Fractal();
	void Generate(int gridsize,float varience);
	~Fractal();

	int NumOfNodes();
	float GetPoint(int i);
	float GetPoint(int x, int y);
	float GetPoint(D3DXVECTOR2 v);
	D3DXVECTOR3 GetPos(int i);
	int GetGridSize();
	Graph& GetGraph(){return m_Graph;}

	
private:
	Graph m_Graph;
	int m_gridSize;
	std::vector<float> m_vPoints;
};
float GetRand(float var);
bool SquareDiamond(std::vector <std::vector <float>>& heightPoints,D3DXVECTOR2 corners[4], float var);

#endif